import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

Vue.config.productionTip = false

// 加载axios
import http from './http'
// 挂载到vue原型上 方便通过this.$http在任意页面访问
Vue.prototype.$http = http

// 全局混入token
Vue.mixin({
  methods: {
    getAuthorization() {
      return { authorization: 'Bearer ' + localStorage.token || '' }
    }
  },
  computed: {
    uploadUrl(){
      return http.defaults.baseURL+ '/uploads'
    }
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
